fix: release job isn't respecting minor latest streams#3405
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the GitHub Actions release workflow so that v5 patch releases are built from the correct maintenance branch (e.g., 5.2.x) rather than incorrectly releasing from main, which caused the 5.2.4 artifact mismatch reported in #3402.
Changes:
- Derives the release
major.minorfrom the release tag and compares it tomain’spom.xmlversion to decide whether to release frommainor${major.minor}.x. - Updates the v5 branch-selection logic in the release workflow to support “latest minor stream” releases correctly.
| # getting this version from POM would require pulling the whole repo | ||
| MAIN_POM_VERSION=$(curl -s "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | grep -oPm1 '(?<=<version>)[^<]+') | ||
| MAIN_MAJOR_MINOR=$(echo "$MAIN_POM_VERSION" | cut -d. -f1-2) |
3def2b8 to
2eb3d7f
Compare
| RELEASE_MAJOR_MINOR=$(echo "$RELEASE_VERSION" | cut -d. -f1-2) | ||
|
|
||
| # getting this version from POM would require pulling the whole repo | ||
| MAIN_POM_VERSION=$(curl -fsSL "https://raw.githubusercontent.com/${{ github.repository }}/main/pom.xml" | python3 -c " |
There was a problem hiding this comment.
Using a python script for this is way overkill. The previous solution was better, imo. Or we could use something as simple as yq '.project.version' pom.xml
There was a problem hiding this comment.
We are not cloning the repo in this job. So this is why I opted to pull the version like this. Of course we could pull the repo.
There was a problem hiding this comment.
No need to pull the repo: you only need the POM file and run yq on it as shown above. No need for python.
Signed-off-by: xstefank <xstefank122@gmail.com>
2eb3d7f to
1eb5bc4
Compare
This is why 5.2.4 was wrongfully released from
mainand not from5.2.x. I will release 5.2.5 after this PR is merged.Fixes #3402